﻿using System;

public partial class Master : System.Web.UI.MasterPage
{
    ClassDB.DB TradeDB = new ClassDB.DB();

    public string firstpage, dealer_ticket, key_dealer_play,dealer_sent_back,dealer_play_out,
        link_web,dealer_tudroum,dealer_fight_up,dealer_fight_down,dealer_tudroum_out,
        price_player_config,transfer,msg_dealer,msg_agent;



    public string home,services, takeatour;

    protected void Page_Load(object sender, EventArgs e)
    {
        System.IO.FileInfo fi = new System.IO.FileInfo(System.Web.HttpContext.Current.Request.Url.AbsolutePath);
        string currentPagename = fi.Name;
        Actived(currentPagename);

       // Panel_Dealer.Visible = false;
        Panel_Agent.Visible = false;
        Panel_User.Visible = false;

        bindhead();

        //if (Convert.ToUInt32(Session["gametype"]) == 1)
        //{
        //    lbl_head.Text = "หวยรัฐบาล";
        //}
        //else if (Convert.ToUInt32(Session["gametype"]) == 2)
        //{
        //    lbl_head.Text = "หวยหุ้น1";
        //}
        //else if (Convert.ToUInt32(Session["gametype"]) == 3)
        //{
        //    lbl_head.Text = "หวยหุ้น2";
        //}
        //else if (Convert.ToUInt32(Session["gametype"]) == 4)
        //{
        //    lbl_head.Text = "หวยหุ้น3";
        //}
        //else if (Convert.ToUInt32(Session["gametype"]) == 5)
        //{
        //    lbl_head.Text = "หวยหุ้น4";
        //}
        //else if (Convert.ToUInt32(Session["gametype"]) == 6)
        //{
        //    lbl_head.Text = "หวยหุ้น5";
        //}


    }

    private void Actived(string currentPagename)
    {

        firstpage = "";
        dealer_ticket = "";
        key_dealer_play = "";
        dealer_sent_back = "";
        dealer_play_out = "";
        link_web = "";
        dealer_tudroum = "";
        dealer_fight_up = "";
        dealer_fight_down = "";
        dealer_tudroum_out = "";
        price_player_config = "";
        transfer = "";
        msg_dealer = "";
        msg_agent = "";



        switch (currentPagename)
        {
            case "firstpage.aspx":
                {
                    firstpage = "current_page_item";  
                    break;
                }
            case "dealer_ticket.aspx":
                {
                    
                    dealer_ticket = "current_page_item";
                    break;
                }
            case "key_dealer_play.aspx":
                {
                    key_dealer_play = "current_page_item";
                    break;
                }
            case "dealer_sent_back.aspx":
                {
                    dealer_sent_back = "current_page_item";
                    break;
                }

            case "dealer_play_out.aspx":
                {
                    dealer_play_out = "current_page_item";
                    break;
                }

            case "link_web.aspx":
                {
                    link_web = "current_page_item";
                    break;
                }

            case "dealer_tudroum.aspx":
                {
                    dealer_tudroum = "current_page_item";
                    break;
                }

            case "dealer_fight_up.aspx":
                {
                    dealer_fight_up = "current_page_item";
                    break;
                }

            case "dealer_fight_down.aspx":
                {
                    dealer_fight_down = "current_page_item";
                    break;
                }
            case "dealer_tudroum_out.aspx":
                {
                    dealer_tudroum_out = "current_page_item";
                    break;
                }
            case "price_player_config.aspx":
                {
                    price_player_config = "current_page_item";
                    break;
                }
            case "transfer.aspx":
                {
                    transfer = "current_page_item";
                    break;
                }
            case "msg_dealer.aspx":
                {
                    msg_dealer = "current_page_item";
                    break;
                }
            case "msg_agent.aspx":
                {
                    msg_agent = "current_page_item";
                    break;
                }





            default:
                {
                    firstpage = "current_page_item";
                    break;
               }
        }


        
    }


    private void bindhead()
    {
        if (Session["gametype"] != null)
        {
            string sql = "select * from tbl_dashboard where dash_id = '" + Session["gametype"] + "'";
            TradeDB.ShowTable(sql, "temp");

            lbl_head.Text ="หมวด :" + TradeDB.Ds.Tables["temp"].Rows[0]["dash_name"].ToString();
        }

    }



}